/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2024/8/30
 * Time: 17:00
 */

#ifndef CLIENT_H
#define CLIENT_H
#include <Content.pb.h>
#include <QtCore>
#include <zmq.hpp>
class Client
{
public:
    explicit Client(const std::string & name);

    ~Client();

    void Run();

    void SendMessage(const Chat::Internal::SingleMessage & message);

private:
    zmq::context_t context_;
    zmq::socket_t  snapshot_sync_;
    zmq::socket_t  subscriber_;
    zmq::socket_t  publisher_;
    int32_t        sequence_ {0};
    std::string    name_;
    QSettings *    settings_ {nullptr};

    //test
    QTimer        timer_;
};

#endif//CLIENT_H
